import request from '@/utils/request'

// 新增工序
export function addGxWithGyRoad(data) {
  return request({
    url: '/scxx/gyRoadConfig',
    method: 'post',
    data: data
  })
}

// 新增工序生产单元
export function addScdyWithGx(data) {
  return request({
    url: '/scxx/gyRoadConfig/addScdy',
    method: 'post',
    data: data
  })
}

// 新增工序生产单元
export function addUserWithGx(data) {
  return request({
    url: '/scxx/gyRoadConfig/addUser',
    method: 'post',
    data: data
  })
}

// 查询工艺路线列表
export function listGyRoadConfig(query1) {
  return request({
    url: '/scxx/gyRoadConfig/gyRoadMore',
    method: 'get',
    params: query1
  })
}

// 查询工序列表
export function listGx(query1) {
  return request({
    url: '/scxx/gyRoadConfig/listGx',
    method: 'get',
    params: query1
  })
}

// 查询生产单元列表
export function listScdy(query1) {
  return request({
    url: '/scxx/gyRoadConfig/listScdy',
    method: 'get',
    params: query1
  })
}

// 查询生产单元列表
export function listUser(query1) {
  return request({
    url: '/scxx/gyRoadConfig/listUser',
    method: 'get',
    params: query1
  })
}

// 删除工艺路线工序
export function delGyRoadAndGx(query) {
  return request({
    url: '/scxx/gyRoadConfig',
    data: query,
    method: 'delete'
  })
}

// 删除工艺路线工序
export function delScdy(query) {
  return request({
    url: '/scxx/gyRoadConfig/delScdy',
    data: query,
    method: 'delete'
  })
}

// 删除工艺路线工序
export function delUser(query) {
  return request({
    url: '/scxx/gyRoadConfig/delUser',
    data: query,
    method: 'delete'
  })
}

// 修改生产班组
export function updateGxSort(data) {
  return request({
    url: '/scxx/gyRoadConfig',
    method: 'put',
    data: data
  })
}

// 查询工序
export function getGxWithGxCode(gxCode) {
  return request({
    url: '/scxx/gyRoadConfig/' + gxCode,
    method: 'get'
  })
}
